package org.example.day20240826;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main1 {
    public static void main(String[] args) {
        List<Integer> listNum = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        String[] strArr = str.split(" ");
        for (String strarr: strArr) {
            listNum.add(Integer.parseInt(strarr));
        }
        int num1 = listNum.get(2);
        listNum.remove(2);
        for (int i = 0; i < num1; i++) {
            int num2 = 0;
            int num3 = 0;
            if(listNum.get(i) * listNum.get(i+1)/10 == 0){
                listNum.add(listNum.get(i) * listNum.get(i+1));
            }else{
                num2 = listNum.get(i) * listNum.get(i+1)/10;
                listNum.add(num2);
                num3 = listNum.get(i) * listNum.get(i+1)%10;
                listNum.add(num3);
            }
        }
        int[] arr = new int[num1];
        for (int i = 0; i < num1; i++) {
            arr[i] = listNum.get(i);
            System.out.print(arr[i]);
            if(i!=num1-1){
                System.out.print(" ");
            }
        }
    }
}
